<extend name="Public/base"/>

<block name="content">

<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i
				class="icon-home"></i> 首页</a> <a href="javascrpit:void(0);" class="tip-bottom">系统设置</a><a href="{:U('Category/index')}" class="current">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content ">
						<form action="{:U($type)}" method="post" class="form-horizontal">
						
							<label class="control-label" style="width:150px;" >目标分类({$meta_title}) :</label>
							<div class="controls" style="margin-left:180px;">
								<select name="to" class="span5">
									<volist name="list" id="vo">
										<option value="{$vo.id}" relevel="{$vo.level|default=0}">{$vo.title}</option>
									</volist>
								</select>
							</div>
							
							<br>
							<br>
							<div class="form-actions">
								<input type="hidden" name="from" value="{$from}">
								<input type="hidden" name="level" value="{$level}">
								<input type="hidden" name="relevel" value="0">
								<button type="button" id="submit" class="btn submit-btn ajax-post btn-success">确 定</button>
								<button type="button" class="btn btn-danger" onclick="javascript:history.back(-1);return false;">返 回</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	$("#submit").click(function(){
		//锁定提交按钮
		$(this).attr('disabled',true);
		var self = $('form');
		$.post("{:U($type)}", self.serialize(), call_back, "json");
		return false;
		/**
		 * @todo 接收登录返回值
		 */
		function call_back(data){
			if(data.status == 1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
					window.location.href = data.url;
				},1000);
			} else {
				tke_alert(data.info,'alert-error');
				$("#submit").attr('disabled',false);
			}
		}
	});
});
highlight_subnav('{:U('Category/index')}');
</script>
</block>

